{extend name="common:main" /}
{block name="cssjs"}
<script src="__PUBLIC__/static/js/admin/mystore.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
{php}$orderClass=array($orderKey=>'_'.$sortBy);$orderSort=array($orderKey=>($sortBy=='asc'?'升序':'倒序'));{/php}
<div class="nav-tabs-custom">
	<ul class="nav nav-tabs">
    	<li><a href="{:url('Mystore/rule')}">采集规则</a></li>
    	<li class="active"><a href="{:url('Mystore/releaseApp')}">发布插件</a></li>
    	<li><a href="{:url('Mystore/funcApp')}">函数插件</a></li>
    	<li class="nav-tab-right">
    		<div class="nav-check-update">
    			<a href="javascript:;" id="check_update">检测更新</a>
    			<input type="checkbox" id="auto_check" {:is_empty(g_sc_c('store_auto_check_plugin'))?'':'checked="checked"'} value="1" title="刷新页面时自动检测" />
    		</div>
    		<span class="nav-sep">|</span>
    		<div class="nav-upload"><a href="{:url('Mystore/upload')}" onclick="windowModal('导入插件',$(this).attr('href'));return false;">导入插件</a></div>
    	</li>
	</ul>
	<div class="tab-content">
		<div class="tab-pane active">
		    <div class="table-responsive">
				<form id="form_list" method="post" ajax-submit="true" action="{:url('Mystore/releaseAppOp')}">
				{:html_usertoken()}
				<table id="list_table" class="table table-hover datatable">
					<thead>
						<tr>
							<th class="chk">{$Think.lang.select}</th>
							<th class="sorting{$orderClass['name']}" data-order="name" title="名称{$orderSort['name']}">名称</th>
							<th class="sorting{$orderClass['app']}" data-order="app" title="app{$orderSort['app']}">标识</th>
							<th>模块</th>
							<th class="sorting{$orderClass['addtime']}" data-order="addtime" title="本地添加时间{$orderSort['addtime']}">本地添加</th>
							<th class="sorting{$orderClass['uptime']}" data-order="uptime" title="平台更新时间{$orderSort['uptime']}">平台更新</th>
							<th>平台</th>
							<th>{$Think.lang.op}</th>
						</tr>
					</thead>
					<tbody>
					{foreach name="appList" item="app"}
						<tr data-app-id="{$app['id']}">
							<td class="chk"><input type="checkbox" name="ids[]" value="{$app['id']}" /></td>
							<td><div class="name">{$app['name']}</div></td>
							<td>{$app['app']}</td>
							<td>{$app['module']}</td>
							<td>{:date('Y-m-d H:i',$app['addtime'])}</td>
							<td>{:date('Y-m-d H:i',$app['uptime'])}</td>
							<td>
								<a href="javascript:;" data-url="{$app['_store_url']}" class="store-detail">{$app['_is_provider']?'第三方':'官方'}</a>
							</td>
							<td>
								<div class="in-line-mg"><a href="{:url('Develop/releaseCms?app='.$app['app'])}">开发</a></div>
								<div class="in-line-mg"><a href="javascript:;" url="{:url('Mystore/releaseAppOp?op=delete&id='.$app['id'])}" class="delete">删除</a></div>
							</td>
						</tr>
					{/foreach}
					</tbody>
					<tfoot>
						<tr>
							<td class="chk"><label><input type="checkbox" id="chkall" onclick="checkall(this,'ids[]')" />全部</label></td>
							<td colspan="2">
								<button type="button" class="btn btn btn-danger" id="deleteall">{$Think.lang.delete}</button>
								&nbsp;<a href="{:url('Develop/releaseCms')}" class="btn btn btn-success">开发一个</a>
							</td>
							<td colspan="5" style="text-align:right;font-size:12px;">
								{if !empty($appList)}
								<p class="help-block">在 “任务 &gt; 发布设置 &gt; 本地CMS程序” 中使用</p>
								{/if}
							</td>
						</tr>
		    			{if condition="!empty($pagenav)"}
						<tr>
							<td colspan="8">{$pagenav}</td>
						</tr>
						{/if}
					</tfoot>
				</table>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
myStoreClass.init_releaseapp();
</script>
{/block}